package cn.zptc.springbootdemo.domain;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * @author ：zhaoweiwei
 * @date ：创建于 2025/3/3 13:44
 * @description：
 * @modified By：
 * @version: 1.0.0
 */
@Component
@PropertySource("classpath:user.properties")
@ConfigurationProperties("user")
public class User implements Serializable {
    private String id;
    private String nickname;
    private String name;
    private  String role; //用户角色
    public  User(String name, String role) {
        this .name = name;
        this .role = role;
    }

    public User() {
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    @Override
    public String toString() {
        return "User{" +
                "id='" + id + '\'' +
                ", nickname='" + nickname + '\'' +
                ", name='" + name + '\'' +
                ", role='" + role + '\'' +
                '}';
    }
}
